/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package co.edu.uniandes.vehialpes.facades;

import co.edu.uniandes.vehialpes.entity.Taller;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Cquiroga
 */
@Stateless
public class TallerFacade extends AbstractFacade<Taller> implements TallerFacadeLocal {
    @PersistenceContext(unitName = "VehiAlpesPU")
    private EntityManager em;

    private Class<Taller> tallerClass;
    
    protected EntityManager getEntityManager() {
        return em;
    }

    public TallerFacade() {
        super(Taller.class);
    }
    
    public Taller find(Object id) {
        return getEntityManager().find(tallerClass, id);
    }
     
    public List<Taller> findAll(){
        /*javax.persistence.criteria.CriteriaQuery cq = getEntityManager().getCriteriaBuilder().createQuery();
        cq.select(cq.from(tallerClass));*/
        
        //return getEntityManager().createQuery(cq).getResultList();
        return(super.findAll());
    }
    
    
}
